﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MLM.AdminCP;

namespace MLM.AdminCP.Pages
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            txtLogin.Click += new EventHandler(txtLogin_Click);

        }

        void txtLogin_Click(object sender, EventArgs e)
        {
            if (txtUserId.Text.Trim()!="")
            {
                try
                {
                    if (!Permission.CheckLoginInfo(long.Parse(txtUserId.Text.Trim()), txtPassword.Text.Trim()))
                    {
                        txtError.Text = "Login fail! Please check your id and password!";
                    }   
                }
                catch (Exception)
                {
                    txtError.Text = "Login fail! Please check your id and password!";
                }                
            }            
        }
    }
}